home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / crystal / random.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-12  |  310 b   |  14 lines

  1. /* random.h
  2.  *************************************************************************/
  3.  
  4. #include    <math.h>
  5.  
  6. double drand48();    /* 0 to 1 */
  7.  
  8. long lrand48();        /* 0 to 2^31-1 */
  9.  
  10. long mrand48();        /* -2^31 to 2^31-1 */
  11.  
  12. #define    RAN(num)    ((int)floor(drand48()*(num)))
  13. #define    PCT(num)    ((drand48() * 100.0) < (num))
  14.